//
//  JBWBaseViewController.m
//  JBWDSK
//
//  Created by 崔志伟 on 2018/7/27.
//  Copyright © 2018年 崔志伟. All rights reserved.
//

#import "JBWBaseViewController.h"

@interface JBWBaseViewController ()
@end

@implementation JBWBaseViewController
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.modalPresentationStyle = UIModalPresentationOverCurrentContext;
        self.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor clearColor];
   
}

-(void)setBackTitle:(NSString *)backTitle{
    _backTitle = backTitle;
    if (!self.navView) {
        self.navView =  [JBWLoginNavView showNavViewBackTitle:_backTitle backNavBlock:^{
            [self dismissViewControllerAnimated:NO completion:self.dismissBlock];
        }];
        [self.bgContentView addSubview:self.navView];
    }
}
- (void)setBgContentViewHight:(CGFloat)bgContentViewHight{
    _bgContentViewHight = bgContentViewHight;
    [self.view addSubview:self.bgContentView];
}
- (void)removeBgContentViewAllSubView{
    [self.navView removeFromSuperview];
    self.navView = nil;
    [self.bgContentView removeFromSuperview];
    self.bgContentView = nil;
}

- (UIView *)bgContentView{
    if (!_bgContentView) {
        _bgContentView= [[JBWMainBgView alloc]initWithFrame:CGRectMake(0, 0, MAIN_BG_VIEW_WIDTH, _bgContentViewHight)];
    }
    return _bgContentView;
}
@end
